export default function createTwoWayMap<Arr1, Arr2>(
  arr1: Arr1[],
  arr2: Arr2[]
): Map<Arr1 | Arr2, Arr1 | Arr2> | undefined {
  if (arr1.length !== arr2.length) {
    return undefined;
  } else {
    const m = new Map();
    arr1.forEach((v, i) => {
      m.set(v, arr2[i]);
    });
    arr2.forEach((v, i) => {
      m.set(v, arr1[i]);
    });
    return m;
  }
}
